# -*- coding: utf-8 -*- 
# @project : 《Atcoder》
# @Author : created by bensonrachel on 2021/9/2
# @File : LC deque 用栈实现队列.py
from collections import deque
class MyQueue:

    def __init__(self):
        """
        Initialize your data structure here.
        """
        self.que = deque()

    def push(self, x: int) -> None:
        """
        Push element x to the back of queue.
        """
        self.que.append(x)

    def pop(self) -> int:
        """
        Removes the element from in front of queue and returns that element.
        """
        return self.que.popleft()

    def peek(self) -> int:
        """
        Get the front element.
        """
        return self.que[0]

    def empty(self) -> bool:
        """
        Returns whether the queue is empty.
        """
        return not self.que

# Your MyQueue object will be instantiated and called as such:
# obj = MyQueue()
# obj.push(x)
# param_2 = obj.pop()
# param_3 = obj.peek()
# param_4 = obj.empty()